package cn.ad.enumration;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

/**
 * User: shirongkang
 * Date: 2016/12/7
 * Time: 14:32
 * Desc:
 */
public enum SitesetEnum {
    SITESET_QZONE("SITESET_QZONE","QQ空间（PC）"),//QQ空间（PC）
    SITESET_QQ_CLIENT("SITESET_QQ_CLIENT","QQ客户端（PC）"),//QQ客户端（PC）
    SITESET_QQ_MUSIC("SITESET_QQ_MUSIC","QQ音乐"),//QQ音乐
    SITESET_MOBILE_UNION("SITESET_MOBILE_UNION","腾讯广告联盟"),//腾讯广告联盟
    SITESET_WECHAT("SITESET_WECHAT","微信"),//微信
    SITESET_OTHER_INNER_MOBILE("SITESET_OTHER_INNER_MOBILE","腾讯社交广告内部移动站点");//腾讯社交广告内部移动站点
	
	private String value;
    private String description;
    private static LinkedHashMap<String,String> mappings;
    private static List<Dropdown> list;
    private synchronized static LinkedHashMap<String,String> getMappings() {
        if (mappings == null) {
            mappings = new java.util.LinkedHashMap<>();
            for (SitesetEnum format : SitesetEnum.values()) {
            	mappings.put(format.value, format.description);
            }
        }
        return mappings;
    }
    public static LinkedHashMap<String,String> getMapping(){
        return getMappings();
    }

    private SitesetEnum(String value, String description) {
        this.description = description;
        this.value = value;
    }
    public String getDescription() {
        return this.description;
    }
    
    public String getValue() {
		return value;
	}
	public static List<Dropdown> getListModel(){
        return getList();
    }
    
    private synchronized static List<Dropdown> getList() {
        if (list == null) {
            list = new ArrayList<>();
            for (SitesetEnum format : SitesetEnum.values()) {
            	list.add(new Dropdown(format.value, format.description));
            }
        }
        return list;
    }
}
